package qingke.hibernate.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name = "teacher")
@Entity
public class Teacher {
	@Id
	@Column(name="id")
	private int id;
	@Column(name="name")
	private String name;
	@Column(name="code")
	private String code;
	@Column(name="gender")
	private String gender;
	@Column(name="phone")
	private String phone;
	@Column(name="email")
	private String email;
	@Column(name="age")
	private int age;
	
	@OneToMany
	@JoinColumn(name = "teacher_id")
	private Set<CourseSetting> courseSetting;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public Set<CourseSetting> getCourseSetting() {
		return courseSetting;
	}

	public void setCourseSetting(Set<CourseSetting> courseSetting) {
		this.courseSetting = courseSetting;
	}

	@Override
	public String toString() {
		return "Teacher [id=" + id + ", name=" + name + ", code=" + code + ", gender=" + gender + ", phone=" + phone
				+ ", email=" + email + ", age=" + age + "]";
	}
	
	
}
